Post

Replies

Boosts

Views

Activity

Reply to "applicationWillTerminate" not called
OK. I did the followings; class AppDelegate: NSObject, UIApplicationDelegate { private var isTaskKilled = true func applicationDidEnterBackground(_ application: UIApplication) { isTaskKilled = false } func applicationWillEnterForeground(_ application: UIApplication) { if isTaskKilled { // Do something when task killed. } } }
Topic: Design SubTopic: General Tags:
Sep ’24
Reply to LAPolicy.deviceOwnerAuthenticationWithBiometrics always returns "success" when back from background.
Thank you for your response. Please let me tell you another additional information, which is, I use SwiftUI. Please let me answer your questions as follow; The following is the code I use; private var context = LAContext() public func checkBiometric() -> Future<Bool, Error> { Future { [context] promise in Task { [promise, context] in context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: "Some reason") { success, error in if success { promise(.success(success)) } else { promise(.failure(error as! LAError)) } } } } } This is called right after lifecycle status becomes "active" from "background". The test device is iPhone 13 pro with iOS 15.5, and Face ID. If you need more information, please feel free to contact me. Best regards,
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to LAPolicy.deviceOwnerAuthenticationWithBiometrics always returns "success" when back from background.
Additional information, Biometrics authentication works when first login to my iOS app. Finish app and go to background Activate app to get back from background. Biometrics authentication works but always returns "success" It works fine at 1. operation because it is the very first Biometrics authentication. On the other hand, it always returns "success" from 2nd trial. If I terminate the app and re-activate it, Biometrics authentication works fine. Therefore, I wonder if Biometrics authentication would not work correctly when get back from background.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to Special camera application issue
ssmith_c, sorry for my late response. Thank you for your response. Yes, I understand what you are saying and you are right. I can get much better picture when I record a video, but can not get the same quality for a still picture. So, I think the problem shows when I shoot a still picture. The reason may be less light, though.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to AutoLayout constraint reset after tableView cell is created.
The following is a part of my code; func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { ... if let url = URL(string: urlString) { cell.imageView.sd_setImage(with: url, completed: { image, error, _, _ in if let error = error { print(error) return } if let image = image { let imageAspect = image.size.height / image.size.width cell.imageViewHeightConstraint.constant = tableView.frame.width * imageAspect tableView.reloadRows(at: [indexPath], with: .none) } }) } ... } I tried to call setNeedsLayout on the cell by replacing tableView.reloadRows(at: [indexPath], with: .none) with cell.setNeedsLayout(), it did not work. Anyway, thank you for your information.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’22
Reply to iPhone 13 / 13 mini builtInUltraWideCamera trouble
Additional information. I tried the following code with iPhone 13 and 13 mini. captureDevice = AVCaptureDevice.default(AVCaptureDevice.DeviceType.builtInUltraWideCamera, for: AVMediaType.video, position: .back) if !captureDevice.isFocusModeSupported(.autoFocus) {       print("autoFocus not supported")     }     if !captureDevice.isFocusModeSupported(.continuousAutoFocus) {       print("continuousAutoFocus not supported")     }     if !captureDevice.isFocusModeSupported(.locked) {       print("locked not supported")     } } The result is all "not supported". That means the ultra-wide camera has no focus mode. Does this mean "fixed focus"? To Apple Support Team, please let me know if this is true.
Oct ’21
Reply to iPhone 13 / 13 mini builtInUltraWideCamera trouble
Additional information, I tried the following code with iPhone 13 / 13 mini without checking "captureDevice.isFocusModeSupported(.autoFocus)"; do {       try captureDevice.lockForConfiguration()       captureDevice.focusMode = .autoFocus       captureDevice.unlockForConfiguration()     } catch _ {     } The result is my app collapsed. From this symptom, it seems the ultraWideCamera of iPhone 13 / 13 mini does not support "autoFocus", but iPhone 13 pro does. Is this correct spec? or iOS 15 bug?
Oct ’21
Reply to "applicationWillTerminate" not called
OK. I did the followings; class AppDelegate: NSObject, UIApplicationDelegate { private var isTaskKilled = true func applicationDidEnterBackground(_ application: UIApplication) { isTaskKilled = false } func applicationWillEnterForeground(_ application: UIApplication) { if isTaskKilled { // Do something when task killed. } } }
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to "applicationWillTerminate" not called
Self resolved. I found another method which does not require "applicationWillTerminate". Thanks anyway.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to When is the "default alert sound" played?
Self-resolved. It seems other push notifications are sent from APNs, which I did not know. Sorry for disturbing you.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to LAPolicy.deviceOwnerAuthenticationWithBiometrics always returns "success" when back from background.
Thank you for your response. Please let me tell you another additional information, which is, I use SwiftUI. Please let me answer your questions as follow; The following is the code I use; private var context = LAContext() public func checkBiometric() -> Future<Bool, Error> { Future { [context] promise in Task { [promise, context] in context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: "Some reason") { success, error in if success { promise(.success(success)) } else { promise(.failure(error as! LAError)) } } } } } This is called right after lifecycle status becomes "active" from "background". The test device is iPhone 13 pro with iOS 15.5, and Face ID. If you need more information, please feel free to contact me. Best regards,
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to LAPolicy.deviceOwnerAuthenticationWithBiometrics always returns "success" when back from background.
Additional information, Biometrics authentication works when first login to my iOS app. Finish app and go to background Activate app to get back from background. Biometrics authentication works but always returns "success" It works fine at 1. operation because it is the very first Biometrics authentication. On the other hand, it always returns "success" from 2nd trial. If I terminate the app and re-activate it, Biometrics authentication works fine. Therefore, I wonder if Biometrics authentication would not work correctly when get back from background.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Special camera application issue
ssmith_c, sorry for my late response. Thank you for your response. Yes, I understand what you are saying and you are right. I can get much better picture when I record a video, but can not get the same quality for a still picture. So, I think the problem shows when I shoot a still picture. The reason may be less light, though.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to AutoLayout constraint reset after tableView cell is created.
The following is a part of my code; func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { ... if let url = URL(string: urlString) { cell.imageView.sd_setImage(with: url, completed: { image, error, _, _ in if let error = error { print(error) return } if let image = image { let imageAspect = image.size.height / image.size.width cell.imageViewHeightConstraint.constant = tableView.frame.width * imageAspect tableView.reloadRows(at: [indexPath], with: .none) } }) } ... } I tried to call setNeedsLayout on the cell by replacing tableView.reloadRows(at: [indexPath], with: .none) with cell.setNeedsLayout(), it did not work. Anyway, thank you for your information.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to Xcode 13.2.1 does not recognize iOS 15.2
Self solved. I powered off the iPhone 13 pro then powered up it, then did the same process. Xcode recognize iOS 15.2. I do not understand why this power on/off work is required.
Replies
Boosts
Views
Activity
Jan ’22
Reply to Xcode 13.2.1 does not recognize iOS 15.2
Self solved.
Replies
Boosts
Views
Activity
Jan ’22
Reply to iPhone 13 / 13 mini builtInUltraWideCamera trouble
Additional information. I tried the following code with iPhone 13 and 13 mini. captureDevice = AVCaptureDevice.default(AVCaptureDevice.DeviceType.builtInUltraWideCamera, for: AVMediaType.video, position: .back) if !captureDevice.isFocusModeSupported(.autoFocus) {       print("autoFocus not supported")     }     if !captureDevice.isFocusModeSupported(.continuousAutoFocus) {       print("continuousAutoFocus not supported")     }     if !captureDevice.isFocusModeSupported(.locked) {       print("locked not supported")     } } The result is all "not supported". That means the ultra-wide camera has no focus mode. Does this mean "fixed focus"? To Apple Support Team, please let me know if this is true.
Replies
Boosts
Views
Activity
Oct ’21
Reply to iPhone 13 / 13 mini builtInUltraWideCamera trouble
Removed
Replies
Boosts
Views
Activity
Oct ’21
Reply to iPhone 13 / 13 mini builtInUltraWideCamera trouble
Additional information, I tried the following code with iPhone 13 / 13 mini without checking "captureDevice.isFocusModeSupported(.autoFocus)"; do {       try captureDevice.lockForConfiguration()       captureDevice.focusMode = .autoFocus       captureDevice.unlockForConfiguration()     } catch _ {     } The result is my app collapsed. From this symptom, it seems the ultraWideCamera of iPhone 13 / 13 mini does not support "autoFocus", but iPhone 13 pro does. Is this correct spec? or iOS 15 bug?
Replies
Boosts
Views
Activity
Oct ’21